package com.scu.bank.service;

import com.scu.bank.core.jwt.JwtInfo;
import com.scu.bank.util.JwtTokenUtils;
import org.springframework.stereotype.Component;

@Component
public class JwtTokenService {

    /**
     * token过期时间
     */
    private int expire = 1000 * 30;

    public String generatorToken(JwtInfo jwtInfo){
        return JwtTokenUtils.generatorToken(jwtInfo,expire);
    }

    public JwtInfo stringInfoFromToken(String token){
        return JwtTokenUtils.getTokenInfo(token);
    }
}